﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OOLib
{
   /// <summary>
   /// Used to enumerate objects in a container which contains objects. 
   /// </summary>
   public class EnumerationAccess : ComObjectWrapper, IEnumerationAccess
   {
      #region Constructors

      /// <summary>
      /// Constructor
      /// </summary>
      /// <remarks>
      /// After using this constructor, the ComObj must be set manually!
      /// </remarks>
      public EnumerationAccess() :
         base()
      { }

      /// <summary>
      /// Constructor
      /// </summary>
      /// <param name="comObject">COM object</param>
      public EnumerationAccess(object comObject) :
         base(comObject)
      { }

      #endregion

      #region IEnumerationAccess

      /// <summary>
      /// Creates a new enumeration object for this container.
      /// </summary>
      /// <returns>Returns a new enumeration object for this container. It returns NULL if there are no objects in this container.</returns>
      /// <remarks>!!! Not tested !!!</remarks>
      public Enumeration CreateEnumeration()
      {
         CheckDisposed();
         return GetObjectWrapper<Enumeration>(InvokeMethod("createEnumeration"));
      }

      #endregion
   }

   /// <summary>
   /// Used to enumerate objects in a container which contains objects. 
   /// </summary>
   public interface IEnumerationAccess
   {
      /// <summary>
      /// Creates a new enumeration object for this container.
      /// </summary>
      /// <returns>Returns a new enumeration object for this container. It returns NULL if there are no objects in this container.</returns>
      Enumeration CreateEnumeration();
   }
}
